#include <iostream>
#include <queue>
#include <mutex>
#include <thread>
#include <complex>
#include "read_signal.hpp"
#include "qpsk_mod.hpp"
#include "myfft.hpp"
#include "my_usrp.hpp"
#include "process_data.hpp"
#include "main.hpp"

using namespace std;

mutex mtx;
int main()
{
    create_message("./test.txt", 16 * SYMBOLS_ONE_FRAME);
    int NID = 100;
    MY_PROCESS_DATA process_data(NID, FFT_SIZE, false);
    // std::thread th;
    // th = std::thread(&MY_PROCESS_DATA::process_data, &process_data);
    // process_data.process_data();
    MY_USRP usrp_0;
    // usrp_0.my_usrp_tx();
    std::thread th[2];
    th[0] = std::thread(&MY_PROCESS_DATA::process_data, &process_data);
    th[0].join();
    th[1] = std::thread(&MY_USRP::my_usrp_tx, &usrp_0);
    th[1].join();
}